home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
jovept2.arc
/
STAT.C
< prev
next >
Wrap
Text File
|
1985-05-30
|
1KB
|
49 lines
/* stat.c */
/* JOVE/MSDOS. K. Mitchum 1/85 */
/* Ken Mitchum */
/* University of Pittsburgh */
/* Decision Systems Laboratory */
/* misc. file functions for ms-dos to simulate stat() call */
/* K. Mitchum 1//84 */
#include "stat.h"
#define MODE 0
extern unsigned char *filedir();
static unsigned char *filelist;
struct ff_str {
char dummy[21]; /* reserved for dos */
unsigned char attribute; /* returned attribute */
unsigned time;
unsigned date;
long size; /* size of file */
unsigned char fn[13]; /* string containing the filename */
};
stat(filename,stbuf)
unsigned char *filename;
struct stat *stbuf;
{
unsigned char *p, *q;
int i = 1;
p = filename;
for(p = filename;*p; p++)
if((*p >= 'a') && (*p <= 'z')) *p &= 0x5f;
q = p = filedir("*.*",MODE);
while(*p) {
if(strcmp(p,filename) == 0) {
stbuf->st_ino = i;
return(0);
}
i++;
p += strlen(p)+1;
}
free(q);
return(-1);
}
/* end */